/*
 * 	Flan.Zeng 2011-2016	http://git.oschina.net/signup?inviter=flan
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.flan.study.java;

/**
 * 冒泡排序
 * @author flan
 * @date   2015年10月14日
 */
public class MaoPaoSort {
	
	private static int[] number={2,1,8,4,5,0,9,3,7,6};
	
	public static void main(String[] args) {
		int temp;
		for(int i=0;i<number.length-1;i++){
			for(int j=i+1;j<number.length;j++){
				if(number[i]>number[j]){
					temp = number[i];
					number[i] = number[j];
					number[j] = temp;
				}
			}
			
		}
		
		for(int i : number){
			System.out.println(i);
		}
	}
	
}
